<template>
  <div>
    <span>请选择你喜欢的专栏: </span>
    <br />
    <!-- 
        复选框(单独记忆) - 重点(张口就来)
        v-model的vue变量, 值的类型  非数组 - 关联的是标签的checked(选中状态)属性
        v-model的vue变量, 值的类型  数组   - 关键的是标签的value属性
       -->
    <input type="checkbox" v-model="hobby" value="科幻" /> <span>科幻</span>
    <input type="checkbox" v-model="hobby" value="喜剧" /> <span>喜剧</span>
    <input type="checkbox" v-model="hobby" value="动漫" /> <span>动漫</span>
    <input type="checkbox" v-model="hobby" value="冒险" /> <span>冒险</span>
    <input type="checkbox" v-model="hobby" value="科技" /> <span>科技</span>
    <input type="checkbox" v-model="hobby" value="军事" /> <span>军事</span>
    <input type="checkbox" v-model="hobby" value="娱乐" /> <span>娱乐</span>
    <input type="checkbox" v-model="hobby" value="奇闻" /> <span>奇闻</span>
    <ul>
      <li v-for="(val, index) in hobby" :key="index">{{ val }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      hobby: [],
    };
  },
};
</script>

<style>
</style>